package org.lc.service.system.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.lc.platform.base.vo.LcVo;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Schema()
public class SysLoggerVo extends LcVo {
    /**
     * IP
     */
    @Schema(description = "请求IP")
    private String clientIp;


    /**
     * 请求开始时间
     */
    @Schema(description = "请求开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    /**
     * 请求结束时间
     */
    @Schema(description = "请求结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    /**
     * 请求API路径
     */
    @Schema(description = "请求API路径")
    private String requestUri;

    /**
     * 请求类型
     */
    @Schema(description = "请求类型")
    private String method;

    /**
     * 响应时长
     */
    @Schema(description = "响应时长")
    private Long duration;

    /**
     * 输出内容信息
     */
    @Schema(description = "输出内容信息")
    private String responseBody;

    /**
     * 日志分类
     */
    @Schema(description = "日志分类")
    private String category;

    /**
     * 日志操作对象
     */
    @Schema(description = "日志操作对象")
    private OperatorUser operator;

    @Data
    static
    class OperatorUser {
        private String name;
    }
}
